package com.fzkj.bio;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * @DESCRIPTION: TODO
 * @AUTHOR: AnotherOne
 * @DATE: 2021/9/30 9:24
 */
public class StreamTranmit {

    public static void main(String[] args) {
        FileInputStream is = null;
        try {
            is = new FileInputStream("F:\\supermap\\新建文本文档 (2).txt");
            receive(is);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } finally {
            if (is != null){
                try {
                    is.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static void receive(FileInputStream is){
        int available = 0;
        try {
            available = is.available();
//            byte[] b = new byte[1024];
//            is.read(b);
//            System.out.println(Arrays.toString(b));
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println(available);
    }
}
